package db_java;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import java.util.LinkedList;

import com.basicorm.EntityStorage;
import com.basicorm.EntityStorageImpl;

public class CompanyDao implements Dao<Company> {
	
	EntityStorage<Company> dao; 
	
	Connection connection;
	
	CompanyDao(Connection connection){
		this.connection=connection;
		dao=new EntityStorageImpl<>(connection, Company.class);
	}
	
	public Collection<Company> findAll() throws SQLException {
		return dao.findAll();
	}
	
	@Override
	public Collection<Company> findByExample(Company example) throws SQLException {
		return dao.findByExample(example);
	}


	@Override
	public void insertInTable(Company entry) throws SQLException {
		dao.insert(entry);
	}
	

}
